package sctu.edu.java.year2016.team02.wanggaowen.day20160522.chapter6_1;

/**
 * Created by 15c on 2016/5/24.
 */
public class work6_1 {

        public static void main(String[] args) {
            String arr = "mingrikejijavabu";
            int count = 0;
            for (int i = 0; i < arr.length(); i++) {
                if (arr.charAt(i)=='i') ++count;//字符串中元素与i进行比较
            }System.out.print("i出现的次数：" + count);
        }

    }


